package com.example.tb_base.base_viewbinding_activity_fragment

import android.view.View
import androidx.viewbinding.ViewBinding
import com.example.tb_base.base_activity_fragment.BaseActivity

/**
 * 基于ViewBinding的Activity基类，统一处理布局加载、WindowInsets适配等通用逻辑。
 * 子类只需实现抽象方法即可快速搭建自己的Activity。
 */
abstract class BaseViewBindingActivity<VB : ViewBinding> : BaseActivity() {
    protected val binding: VB by lazy {
        createViewBinding()
    }

    protected abstract fun createViewBinding(): VB
    final override fun rootView(): View? = binding.root

    override fun initializeContentView() {
        setContentView(binding.root)
    }
}
